/**getchar and fgets*/
/**how to clear stdin buffer*/
#include<stdio.h>
int main(void)
{
	int ch;
	ch=getchar();
	printf("ch:%c\n",ch);
	char str[128]={0};
	//getchar();
	//getchar();
	//while(getchar()!='\n')	continue;
	//fflush(stdin);//did not work
	setbuf(stdin,NULL);
	fgets(str,sizeof(str),stdin);
	printf("%s",str);
	ch=fgetc(stdin);
	printf("ch:%c\n",ch);
	return 0;
}
